from django.db import models


class Users(models.Model):
    user_account = models.CharField(verbose_name="用户账号", max_length=50, blank=False)
    user_name = models.CharField(verbose_name="用户名", max_length=30,blank=False)
    password = models.CharField(verbose_name="密码", max_length=350, blank=False)
    tel = models.CharField(verbose_name="电话号码", max_length=20, blank=True)
    email = models.CharField(verbose_name="邮箱", max_length=255, blank=True)
    key = models.CharField(verbose_name="登录key", max_length=255, blank=True)
    age = models.IntegerField(verbose_name="用户年龄", blank=True)
    sex = models.CharField(verbose_name="性别", max_length=5, blank=True)
    create_date = models.DateTimeField(verbose_name='创建时间', auto_now=True)

    class Meta:
        verbose_name = "登录信息"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.user_account
